/*
 * @Descripttion: GGB
 * @version: 1.0
 * @Author: GGB
 * @Date: 2021-08-17 16:53:26
 * @LastEditors: GGB
 * @LastEditTime: 2021-08-17 16:56:28
 */
class WristbandModel {
  String name;
  String address;
  String avatar;
  int rate;
  int heart;

  WristbandModel({this.name, this.address, this.avatar, this.rate, this.heart});

  WristbandModel.fromJson(Map<String, dynamic> json) {
    name = json['name'];
    address = json['address'];
    avatar = json['avatar'];
    rate = json['rate'];
    heart = json['heart'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['name'] = this.name;
    data['address'] = this.address;
    data['avatar'] = this.avatar;
    data['rate'] = this.rate;
    data['heart'] = this.heart;
    return data;
  }
}

class WristbandDetailModel {
  int total;
  Userinfo userinfo;
  Pos pos;
  int rate;
  int temperature;
  List<Rows> rows;

  WristbandDetailModel(
      {this.total,
      this.userinfo,
      this.pos,
      this.rate,
      this.temperature,
      this.rows});

  WristbandDetailModel.fromJson(Map<String, dynamic> json) {
    total = json['total'];
    userinfo = json['userinfo'] != null
        ? new Userinfo.fromJson(json['userinfo'])
        : null;
    pos = json['pos'] != null ? new Pos.fromJson(json['pos']) : null;
    rate = json['rate'];
    temperature = json['temperature'];
    if (json['rows'] != null) {
      rows = new List<Rows>();
      json['rows'].forEach((v) {
        rows.add(new Rows.fromJson(v));
      });
    }
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['total'] = this.total;
    if (this.userinfo != null) {
      data['userinfo'] = this.userinfo.toJson();
    }
    if (this.pos != null) {
      data['pos'] = this.pos.toJson();
    }
    data['rate'] = this.rate;
    data['temperature'] = this.temperature;
    if (this.rows != null) {
      data['rows'] = this.rows.map((v) => v.toJson()).toList();
    }
    return data;
  }
}

class Userinfo {
  String avatar;
  String name;
  String grade;

  Userinfo({this.avatar, this.name, this.grade});

  Userinfo.fromJson(Map<String, dynamic> json) {
    avatar = json['avatar'];
    name = json['name'];
    grade = json['grade'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['avatar'] = this.avatar;
    data['name'] = this.name;
    data['grade'] = this.grade;
    return data;
  }
}

class Pos {
  double longitude;
  double latitude;

  Pos({this.longitude, this.latitude});

  Pos.fromJson(Map<String, dynamic> json) {
    longitude = json['longitude'];
    latitude = json['latitude'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['longitude'] = this.longitude;
    data['latitude'] = this.latitude;
    return data;
  }
}

class Rows {
  int time;
  int count;

  Rows({this.time, this.count});

  Rows.fromJson(Map<String, dynamic> json) {
    time = json['time'];
    count = json['count'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['time'] = this.time;
    data['count'] = this.count;
    return data;
  }
}
